<extend name="../layout" />

<block name="main_content">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title"> <span class="icon"><i class="icon-search"></i></span>
                    <h5>{:L('filter')}</h5>
                </div>
                <div class="widget-content nopadding">
                    <form style="padding:5px 5px 0" method="GET">
                        <div class="controls controls-row">
                            <select name="filter_field" class="span1">
                                <option value="subject">{:L('subject')}</option>
                            </select>
                            <input type="text" name="filter_value" class="span1 m-wrap">
                            <select name="stock_id" class="span1">
                                <option value="">所有</option>
                                <volist name="stocks" id="s">
                                    <option value="{$s.id}">{$s.name}</option>
                                </volist>
                            </select>
                            <div data-date="" class="input-append date datepicker span1">
                                <input type="text" value="" data-date-format="yyyy-mm-dd" name="date_start" class="span11">
                                <span class="add-on"><i class="icon-th"></i></span> 
                            </div>
                            <div data-date="" class="input-append date datepicker span1">
                                <input type="text" value="" data-date-format="yyyy-mm-dd" name="data_end" class="span11">
                                <span class="add-on"><i class="icon-th"></i></span> 
                            </div>
                            <button class="btn btn-primary m-wrap span1" type="submit">{:L('search')}</button>
                            <a href="{:U('/JXC/Stockin')}" class="btn btn-info span1 m-wrap">{:L('All')}</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="widget-box">
        <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
            <h5>{:L('stock_in_paper')}</h5>
            <a href="{:U('add')}" class="label label-info">{:L('add_new_stock_in_paper')}</a>
        </div>
        <div class="widget-content nopadding">
            <table class="table table-bordered table-striped with-check">
              <thead>
                <tr>
                    <th>{:L('id')}</th>
                    <th>{:L('subject')}</th>
                    <th>{:L('stock_name')}</th>
                    <th>{:L('dateline')}</th>
                    <th>{:L('status')}</th>
                    <th>{:L('sponsor')}</th>
                    <th>{:L('stock_manager')}</th>
                    <th>{:L('operation')}</th>
                </tr>
              </thead>
              <tbody>
                  <volist name="list" id="t">
                      <tr>
                          <td>{$t.id}</td>
                          <td>{$t.subject}</td>
                          <td>{$t.stock_name}</td>
                          <td>{$t.dateline_lang}</td>
                          <td class="text-center">
                              <if condition="$t[processes][currentNode][status_text]">
                                <span class="badge badge-{$t.processes.currentNode.status_class}">
                                    {$t.processes.currentNode.status_text}
                                </span>
                            <else />
                                <span class="badge badge-{$t.status_class}">
                                    {$t.status_lang}
                                </span>
                            </if>
                          </td>
                          <td>{$t.user_id|toTruename}</td>
                          <td>{$t.stock_manager|toTruename}</td>
                          <td>
                            <if condition="$t[status] eq 0">
                                <a href="javascript:editDetail('{$t.id}');" class="btn btn-mini btn-primary">{:L('edit_detail');}</a>
                                <a href="javascript:del('{$t.id}');" class="btn btn-mini btn-danger">{:L('delete');}</a>
                            <else />
                                <a href="javascript:viewDetail('{$t.id}');" class="btn btn-mini btn-info">{:L('view_detail');}</a>
                            </if>
                            <volist name="t[processes][nextNodes]" id="lpn">
                                <a href="{:U('/JXC/Stockin/doWorkflow/node_id/'.$lpn[id].'/mainrow_id/'.$t[id])}" class="btn btn-mini btn-{$lpn.btn_class}">{$lpn.name}</a> &nbsp;
                            </volist>
                          </td>
                      </tr>
                  </volist>
                    <tr>
                        <td colspan="11">
                            <div class="pagination alternate"><ul>{$page}</ul></div>
                        </td>
                    </tr>
              </tbody>
            </table>
        </div>
    </div>
</block>
